﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ListDepart.ascx.cs" Inherits="Admin_Hurman_Controls_ListDepart" %>
<h2>
    Danh sách phòng ban</h2>
<div style="margin-bottom: 20px">
    <% if (IsAdd())
       { %>
    <a href="/Admin/Hurman/AddEditDepart.aspx">Thêm phòng ban</a>
    <%} %>
</div>
<table class="grid">
    <tr>
        <th width="40px">
        </th>
        <th width="120px">
            Mã phòng
        </th>
        <th>
            Tên phòng ban
        </th>
        <th width="40px">
        </th>
        <th width="40px">
        </th>
    </tr>
    <asp:Repeater ID="repDepart" runat="server" OnItemCommand="repDepart_ItemCommand">
        <ItemTemplate>
            <tr>
                <td align="center">
                    <%# Container.ItemIndex + 1 %>
                </td>
                <td>
                    <div class="click viewPopup" rel='depart,<%# Eval("Id") %>'>
                        <% if (IsEdit())
                           { %>
                        <a href='/Admin/Hurman/AddEditDepart.aspx?id=<%# Eval("Id") %>'>
                            <%# Eval("DepartCode") %></a>
                        <%}
                           else
                           { %>
                        <%# Eval("DepartCode") %>
                        <%} %>
                    </div>
                </td>
                <td>
                    <%# Eval("DepartName") %>
                </td>
                <td align="center">
                    <% if (IsEdit())
                       { %>
                    <a href='/Admin/Hurman/AddEditDepart.aspx?id=<%# Eval("Id") %>'>
                        <img src="/images/button/edit.png" /></a>
                    <%}
                       else
                       { %>
                    <img src="/images/button/edit2.png" />
                    <%} %>
                </td>
                <td align="center">
                    <% if (IsDelete())
                       { %>
                    <asp:LinkButton ID="del" runat="server" OnClientClick="return confirm('Xác nhận xóa?')"
                        CommandName="del" CommandArgument='<%# Eval("Id") %>'><img src="/images/button/delete.png" /></asp:LinkButton>
                    <%}
                       else
                       { %>
                    <img src="/images/button/delete2.png" />
                    <%} %>
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
</table>